Skip to content

Conversation

@walker84837
Copy link
Collaborator

As of now, there is no type inference when evaluating types like var something; and the goal of this PR is to implement a type inference system (Hindley-Milner) to properly evaluate to the correct types.

Later on, type inference should be expanded to also parse C headers (and Kit modules).

Changes also include:
- Change `int` to `Int` and `float` to `Float` in Kit comment examples to use correct types
- Remove "int" and "float" as correct types in types.rs
- Make CompileResult<T> part of `error` module.
@walker84837 walker84837 changed the title Implement HM type inference Implement Hindley-Milner-based type inference Jan 8, 2026
Implemented `parse_bool_literal` to centralize boolean parsing.
Replaced inline boolean match with helper call. Extended primary token
check to include `true` and `false`.

Summary of changes:
- Added `parse_bool_literal` method
- Updated `Rule::boolean` handling to use the new helper
- Modified primary keyword match to route booleans through the helper
@walker84837 walker84837 marked this pull request as ready for review January 8, 2026 12:17
@walker84837 walker84837 force-pushed the feat/add-type-inference branch from 3f8bc2b to 7940459 Compare January 8, 2026 12:44
@walker84837 walker84837 merged commit 21c9fbc into main Jan 8, 2026
3 checks passed
@walker84837 walker84837 deleted the feat/add-type-inference branch January 8, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants